<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('sup_form')" />
</head>
<body class="white-bg">
	<div class="main-content">
		<form class="form-horizontal" id="form">
			<input id="pageFlag" name="pageFlag" type="hidden" th:value="${dbLimit.pageFlag}" />
			<input id="id" name="id" type="hidden" th:value="${dbLimit.id}" />
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">考核组：</label>
				<div class="col-sm-8">
					<select id="khz" name="khz" class="form-control m-b" th:with="dicts=${@dict.getType('rate_khz')}">
						<option value="">请选择</option>
						<option th:each="dict : ${dicts}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
							th:selected="${dbLimit.khz == dict.dictValue}"></option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">考核部门：</label>
				<div class="col-sm-8">
					<select id="dept.deptId" name="dept.deptId"
						class="form-control m-b" required>
						<option value="">请选择</option>
						<option th:each="dept : ${deptList}" th:text="${dept.deptName}"
							th:value="${dept.deptId}"
							th:selected="${dbLimit.dept.deptId == dept.deptId}" />
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">应督办单位个数：</label>
				<div class="col-sm-8">
					<input name="dwgs" id="dwgs" th:value="${dbLimit.dwgs}" class="form-control" type="text" required />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">扣分（上限值）：</label>
				<div class="col-sm-8">
					<input name="kfUp" id="kfUp" th:value="${dbLimit.kfUp}" class="form-control" type="text" required />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">扣分（上限值）单位个数：</label>
				<div class="col-sm-8">
					<input name="kfUpCount" id="kfUpCount" th:value="${dbLimit.kfUpCount}" class="form-control" type="text" required />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">扣分（下限值）：</label>
				<div class="col-sm-8">
					<input name="kfDown" id="kfDown" th:value="${dbLimit.kfDown}" class="form-control" type="text" required />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">扣分（下限值）单位个数：</label>
				<div class="col-sm-8">
					<input name="kfDownCount" id="kfDownCount" th:value="${dbLimit.kfDownCount}" class="form-control" type="text" required />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea class="form-control" name="remark" id="remark"
						th:text="${dbLimit.remark}" rows="3" maxlength="1024"></textarea>
				</div>
			</div>
		</form>
	</div>
	<th:block th:include="include :: footer" />
	<th:block th:include="include :: datetimepicker-css" />
	<th:block th:include="include :: datetimepicker-js" />
	<script>
		var prefix = ctx + "rate/dbLimit";
		var pageFlag = '[[${dbLimit.pageFlag}]]';
		
		$(function() {
			if ("ADD" == pageFlag || "EDIT" == pageFlag) {
			} else if ("VIEW" == pageFlag) {
				$("#form input[type='text']").prop("disabled", true);
				$("#form textarea").prop("disabled", true);
				$("#form select").prop("disabled", true);
			}
		});
		
		function submitHandler() {
			if (pageFlag == "ADD" || pageFlag == "EDIT") {
				if ($.validate.form()) {
					$.modal.confirm("确定保存数据？", function() {
						$.operate.save(prefix + "/save", $('#form').serialize());
					});
				}
			} else {
				var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
				parent.layer.close(index); //再执行关闭
				return true;
			}
		}
	</script>
</body>
</html>
